//
//  WSMineFooterView.m
//  LANGirl
//
//  Created by 吴帅 on 16/3/28.
//
//

#import "WSMineFooterView.h"

@implementation WSMineFooterView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = MAINBACKCOLOR;
        [self creatSubView];
    }
    return self;
}

- (void)creatSubView {
    
    //模板的图片
    UIImageView * banImage = [[UIImageView alloc]init];
    banImage.image = [UIImage imageNamed:@"muban725x725@2p.png"];
    [self addSubview:banImage];
    [banImage mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self);
        make.right.equalTo(self.mas_right).offset(-0.00*AUTO_WIDTH);
        make.left.equalTo(self).offset(0.00*AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH, 235*AUTO_WIDTH));
        
    }];

    //每日签到图片
    UIImageView * singImage = [[UIImageView alloc]init];
    singImage.image = [UIImage imageNamed:@"每日签到190x190.png"];
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(selectAction:)];
    [singImage addGestureRecognizer:tap];
    singImage.tag = 1200;
    singImage.userInteractionEnabled=YES;
    [self addSubview:singImage];
    [singImage mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(15.00 * AUTO_WIDTH);
        make.left.mas_equalTo(30.00*AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(95.00 * AUTO_WIDTH, 100.00 * AUTO_WIDTH));
    }];
    
    
    //每日签到
    UILabel *qiandaoLabel = [[UILabel alloc]init];
    qiandaoLabel.alpha = 0.6;
    qiandaoLabel.text = @"每日签到";
    qiandaoLabel.textAlignment = NSTextAlignmentCenter;
    qiandaoLabel.font = [UIFont fontWithName:@"CourierNewPSMT" size:15.00*AUTO_WIDTH];
    [self addSubview:qiandaoLabel];
    [qiandaoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(singImage.mas_bottom);
        make.left.mas_equalTo(30.00*AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(95.00*AUTO_WIDTH, 100.00*AUTO_WIDTH));
        
    }];
    
    
    //每日速配图片
    UIImageView * pairImage = [[UIImageView alloc]init];
    pairImage.image = [UIImage imageNamed:@"每日速配190x190.png"];
    tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(selectAction:)];
    [pairImage addGestureRecognizer:tap];
    pairImage.userInteractionEnabled = YES;
    pairImage.tag = 1201;
    [self addSubview:pairImage];
    [pairImage mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(singImage);
        make.left.equalTo(singImage.mas_right).offset(15.00*AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(95.00*AUTO_WIDTH, 100.00*AUTO_WIDTH));
        
    }];
    
    
    //每日速配
    UILabel *supeiLabel = [[UILabel alloc]init];
    supeiLabel.userInteractionEnabled = YES;
    supeiLabel.alpha = 0.6;
    supeiLabel.text = @"每日速配";
    supeiLabel.font = [UIFont fontWithName:@"CourierNewPSMT" size:15.00*AUTO_WIDTH];
    supeiLabel.textAlignment = NSTextAlignmentCenter;
    [self addSubview:supeiLabel];
    [supeiLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(pairImage.mas_bottom);
        make.left.equalTo(singImage.mas_right).offset(15.00*AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(95.00*AUTO_WIDTH, 100.00*AUTO_WIDTH));
        
    }];
    
    
    //认证身份图片
    UIImageView * vipImage = [[UIImageView alloc]init];
    vipImage.image = [UIImage imageNamed:@"认证身份285x285.png"];
    vipImage.userInteractionEnabled = YES;
    vipImage.tag = 1202;
    tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(selectAction:)];
    [vipImage addGestureRecognizer:tap];
    [self addSubview:vipImage];
    [vipImage mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(singImage);
        make.right.equalTo(self.mas_right).offset(-30.00*AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(95.00*AUTO_WIDTH, 100.00*AUTO_WIDTH));
        
    }];
    
    
    //身份认证
    UILabel *renzhnegLabel = [[UILabel alloc]init];
    renzhnegLabel.alpha = 0.6;
    renzhnegLabel.text = @"身份认证";
    renzhnegLabel.textAlignment = NSTextAlignmentCenter;
    renzhnegLabel.font = [UIFont fontWithName:@"CourierNewPSMT" size:15.00*AUTO_WIDTH];
    [self addSubview:renzhnegLabel];
    [renzhnegLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(vipImage.mas_bottom);
        make.right.equalTo(self.mas_right).offset(-30.00*AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(95.00*AUTO_WIDTH, 100.00*AUTO_WIDTH));
        
    }];
    
}

- (void)selectAction:(UITapGestureRecognizer *)tap {

    [self.delegate footerPushViewController:tap.view.tag];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
